package com.store.app.utils;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import com.ciwong.libs.widget.CWToast;

/**
 * Created by Administrator on 2016/6/12.
 */
public class ToastUtils {
    private static Toast toast = null;

    public static void showTextToast(Context context,String msg) {
        if(msg.contains("本地网络")){
            CWToast.makeText(context, "请检查本地网络！", Toast.LENGTH_LONG, true)
                    .setToastType(CWToast.TOAST_TYPE_ALERT).show();
        }else{
            if (toast == null) {
                Log.v("zyl","showTextToast");
                toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
            } else {
                toast.setText(msg);
            }
            toast.show();
        }
    }
}
